﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Canteen.Core.Models
{
    //商店
    public class Store : BaseEntity
    {
        public Store()
        {
            Verify = 0;
            Status = 1;
        }

        [MaxLength(32)]
        public string Name { get; set; }
        [MaxLength(64)]
        public string Address { get; set; }//地址
        [MaxLength(8)]
        public string Leader { get; set; }//负责人
        [MaxLength(256)]
        public string Remarks { get; set; }//备注

        [MaxLength(256)]
        public string StoreImgUrl { get; set; }//商店图片

        [Column(TypeName = "DATE")]
        public DateTime? OpeningDate { get; set; }//开业日期

        [StringLength(32)]//AES密钥加密后是24位
        public string Phone { get; set; }//手机号码
        [MaxLength(32)]//MD5加密后是32位
        public string PassWord { get; set; }//密码
        public int Verify { get; set; }//认证审核状态  0未审核、1通过、2不通过
        public int Status { get; set; }//状态  1正常营业、2闭店整改、3永久关闭

        public List<Product> ProductList { get; set; } = new List<Product>();
        public List<ShopOrder> ShopOrderList { get; set; } = new List<ShopOrder>();
    }
}
